package com.hongfasoft.wx.pojo;

import org.apache.log4j.Logger;

import com.hongfasoft.util.DBManager;
import com.xinyusoft.dao.DAO;

public class UserInfo
{
	private Logger log = Logger.getLogger(UserInfo.class);
	/* 是否订阅 */
	private boolean subscribe;
	/* openID */
	private String openID;
	/* nickname */
	private String nickName;
	/* sex */
	private String sex;
	/* city */
	private String city;
	/* country */
	private String country;
	/* province */
	private String province;
	/* language */
	private String language;
	/* headimgurl */
	private String headimgurl;
	/* subscribe_time */
	private long subscribe_time;
	/* unionid */
	private String unionid;

	public boolean isFollower()
	{
		return subscribe;
	}

	public void setSubscribe(boolean subscribe)
	{
		this.subscribe = subscribe;
	}

	public String getOpenID()
	{
		return openID;
	}

	public void setOpenID(String openID)
	{
		this.openID = openID;
	}

	public String getNickName()
	{
		return nickName;
	}

	public void setNickName(String nickName)
	{
		this.nickName = nickName;
	}

	public String getSex()
	{
		return sex;
	}

	public void setSex(String sex)
	{
		this.sex = sex;
	}

	public String getCity()
	{
		return city;
	}

	public void setCity(String city)
	{
		this.city = city;
	}

	public String getCountry()
	{
		return country;
	}

	public void setCountry(String country)
	{
		this.country = country;
	}

	public String getProvince()
	{
		return province;
	}

	public void setProvince(String province)
	{
		this.province = province;
	}

	public String getLanguage()
	{
		return language;
	}

	public void setLanguage(String language)
	{
		this.language = language;
	}

	public String getHeadimgurl()
	{
		return headimgurl;
	}

	public void setHeadimgurl(String headimgurl)
	{
		this.headimgurl = headimgurl;
	}

	public long getSubscribe_time()
	{
		return subscribe_time;
	}

	public void setSubscribe_time(long subscribe_time)
	{
		this.subscribe_time = subscribe_time;
	}

	public String getUnionid()
	{
		return unionid;
	}

	public void setUnionid(String unionid)
	{
		this.unionid = unionid;
	}

	public boolean updateUser()
	{
		boolean result = false;
		try
		{
			String sql = DAO.getSQL("jztj.updateUser");
			Object[] data = toDBData();
			Object o = DAO.update(DBManager.DB_NAME, sql, data);
			result = (o != null);
		} catch (Exception e)
		{
			e.printStackTrace();
			log.error("", e);
		}
		return result;
	}

	private Object[] toDBData()
	{
		Object[] o = null;

		return o;
	}
}
